package com.otod.pm.doc.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.otod.commons.web.BaseController;
import com.otod.sys.file.service.IFileService;

@Controller
@RequestMapping("pm/doc/toPdf")
public class DocToPDFController extends BaseController {
	
	@Autowired
	private IFileService busiFileInfo;
	
	/*@Autowired
	private DocTpMasterService docTpMasterService;*/
	
	
	
	
	/**
	 * 转换文档2PDF
	 * @throws AppException 
	 *//*
	@RequestMapping(value = "docToPdf",method=RequestMethod.POST)
	@ResponseBody
	public String docToPdf(PmDocTpMasterVo pmDocTpMasterVo,HttpServletRequest request) throws AppException{
		if(StringUtils.isEmpty(pmDocTpMasterVo.getUuid())){
			FileVo fileVo =	busiFileInfo.getById(id);
			fileVo.getFileServerPath();
		
		
		return JsonSuccess.factory("文档转换成功！");
	}*/
	
	/**
	 * 根据项目类型获取模板信息
	 * @param prjType
	 * @return
	 *//*
	@RequestMapping(value="getDocTpByPrjType",method=RequestMethod.POST)
	@ResponseBody
	public List<PmDocTpMasterVo> getDocTpByPrjType(String prjType,String initPrjType) {
		Map<String,Object> params = new HashMap<String,Object>(); 
		if(prjType ==null ||prjType==""){
			params.put("prjType", initPrjType);
		}else{
			params.put("prjType", prjType);
		}
		return docTpMasterService.queryForList(params);
   }*/
	
	/**
	 * 根据项目类型获取模板信息
	 * @param prjType
	 * @return
	 *//*
	@RequestMapping(value="getItemBytpId",method=RequestMethod.POST)
	@ResponseBody
	public List<PmDocTpItemVo> getItemBytpId(String tpId) {
		Map<String,Object> params = new HashMap<String,Object>(); 
		if(tpId !=null && tpId!=""){
			params.put("tpId", tpId);
		}
		return docTpService.queryForList(params);
   }*/
	
	/**
	 * 根据项目类型获取模板信息
	 * @param prjType
	 * @return
	 *//*
	@RequestMapping(value="getItemById",method=RequestMethod.POST)
	@ResponseBody
	public PmDocTpItemVo getItemById(@RequestBody String id,HttpServletRequest request) {
		
		return docTpService.getById(id);
   }*/
	
	/**
	 * 查询文档树当前item的所有子节点
	 * @return 
	 *//*
	@RequestMapping(value = "getAllChildItemList", method = RequestMethod.POST)
	@ResponseBody
	public List<PmDocTpItemVo> getAllChildItemList(String id,String tpId) {
		return docTpService.queryChildrenForList(id,tpId);
	}*/

	/**
	 * 保存
	 * @throws AppException 
	 *//*
	@RequestMapping(value = "save")
	@ResponseBody
	public String save(PmDocTpItemVo docTpItemVo,HttpServletRequest request) throws AppException{
		if(StringUtils.isEmpty(docTpItemVo.getUuid())){
			docTpService.insert(docTpItemVo);
		}else{
			Map<String,Object> map = new HashMap<String,Object>();
			map.put("uuid", docTpItemVo.getUuid());
			map.put("docStyle", docTpItemVo.getDocStyle());
			map.put("indexNo", docTpItemVo.getIndexNo());
			map.put("lvl", docTpItemVo.getLvl());
			map.put("parentId", docTpItemVo.getParentId());
			map.put("title", docTpItemVo.getTitle());
			map.put("tpId", docTpItemVo.getTpId());
			docTpService.update(map);
		}
		
		return JsonSuccess.factory("条目保存成功！");
	}*/
	
	
	/**
	 * 删除
	 * @throws AppException 
	 *//*
	@RequestMapping(value = "deleteById", method = RequestMethod.POST)
	@ResponseBody
	public String deleteById(@RequestBody String itemId) throws AppException{
		docTpService.deleteById(itemId);
		
		return JsonSuccess.factory("条目删除成功！");
	}*/
}
